#!/usr/bin/python3
# -*- coding:utf-8 -*-
# __author__ == taoyulong2018@gmail.com
# __time__ == 2023/8/14 9:41
# ===========================================
#       题目名称： 105. 从前序与中序遍历序列构造二叉树
#       题目地址： https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
#       题目描述： https://note.youdao.com/s/LWYgPSzT
# ===========================================


class TreeNode:
    """
        Definition for a binary tree node.
    """

    def __init__(self, val=0, left=None, right=None):
        self.val = val
        self.left = left
        self.right = right


class Solution:
    """
        给定两个整数数组 preorder 和 inorder ，
        其中 preorder 是二叉树的先序遍历，
        inorder 是同一棵树的中序遍历，请构造二叉树并返回其根节点。

        先序遍历：
        中序遍历：
    """
    def buildTree(self, preorder, inorder):
        pass


if __name__ == '__main__':
    s = Solution()
    # [3,9,20,null,null,15,7]
    print(s.buildTree(preorder=[3, 9, 20, 15, 7], inorder=[9, 3, 15, 20, 7]))
    # [-1]
    print(s.buildTree(preorder=[-1], inorder=[-1]))
